package cn.com.huzo.service.hr;

import cn.com.huzo.model.entities.hr.LeaveApplicationEntity;
import huzofw.service.GenericManager;
import java.util.Map;

/**
 * 请假单管理服务对象接口。
 *
 * @author 吴旭
 */
public interface LeaveApplicationManager extends GenericManager<LeaveApplicationEntity, String> {

    /**
     * 创建请假单并启动请假流程。
     *
     * @param application 请假单
     * @param limit
     * @param pageIndex
     * @return 流程实例
     * @throws java.lang.Exception
     */
    Map<String, Object> startWorkflow(LeaveApplicationEntity application, Integer limit, Integer pageIndex) throws Exception;

    /**
     * 取得部门经理的审核任务。
     *
     * @param criterion 条件
     * @return 部门经理的审核任务
     * @throws java.lang.Exception
     */
    Map<String, Object> fetchDeptTaskForPage(Map<String, Object> criterion) throws Exception;

    /**
     * 审批（通过、驳回）
     *
     * @param approvUserId 审批人
     * @param startUserId 流程发起人
     * @param taskId 当前任务ID
     * @param processInstancesId 流程实例ID
     * @param approve 审批结果(teue false)
     * @param flowName 当前审批流程名
     * @param comment 审批意见
     * @return
     * @throws Exception
     */
    Map<String, Object> handleTask(Long approvUserId, Long startUserId, String taskId,
            String processInstancesId, Boolean approve, String flowName, String comment) throws Exception;

    /**
     * 调整申请
     *
     * @param instance 调整的内容
     * @return 
     * @throws Exception
     */
    Integer reapply(LeaveApplicationEntity instance) throws Exception;

    /*
    List<LeaveApply> getpagehrtask(String userid, int firstrow, int rowcount);

    int getallhrtask(String userid);

    List<LeaveApply> getpageXJtask(String userid, int firstrow, int rowcount);

    int getallXJtask(String userid);

    List<LeaveApply> getpageupdateapplytask(String userid, int firstrow, int rowcount);

    int getallupdateapplytask(String userid);

    void completereportback(String taskid, String realstart_time, String realend_time);

    void updatecomplete(String taskid, LeaveApply leave, String reappply);

    List<String> getHighLightedFlows(ProcessDefinitionEntity deployedProcessDefinition, List<HistoricActivityInstance> historicActivityInstances);*/
}
